<?php

namespace app\http\middleware;

use think\facade\Session;

class Check
{
    public function handle($request, \Closure $next)
    {

        // die;
        // 添加中间件执行代码
        // var_dump(Session::get('user_name'));die;
        if (!Session::has('user_name')) {
            return redirect('/home/user/login');
        }
        return $next($request);
    }
}
